<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"95563601T001585","x":-55.900002,"y":-59.500000,"z":-546.000000,"width":100.000000,"height":108.000000,"length":120.000000,"weight":206.000000,"platform":"platform36","order":1,"material":"","type":1,"place":200},{"boxId":"95563601T001584","x":-55.900002,"y":48.500000,"z":-546.000000,"width":100.000000,"height":108.000000,"length":120.000000,"weight":206.000000,"platform":"platform36","order":2,"material":"","type":1,"place":200},{"boxId":"95563601T001583","x":54.099998,"y":-59.500000,"z":-536.000000,"width":100.000000,"height":108.000000,"length":120.000000,"weight":206.000000,"platform":"platform36","order":3,"material":"","type":1,"place":100},{"boxId":"95563601T001582","x":54.099998,"y":33.000000,"z":-536.000000,"width":100.000000,"height":77.000000,"length":120.000000,"weight":145.000000,"platform":"platform36","order":4,"material":"","type":1,"place":100},{"boxId":"95563601T001581","x":23.850000,"y":88.750000,"z":-576.250000,"width":39.500000,"height":34.500000,"length":39.500000,"weight":7.000000,"platform":"platform36","order":5,"material":"","type":1,"place":100},{"boxId":"94263600107M846","x":-98.650002,"y":107.250000,"z":-583.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.680000,"platform":"platform08","order":6,"material":"","type":1,"place":200},{"boxId":"94263600107M849","x":-64.150002,"y":107.250000,"z":-583.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.640000,"platform":"platform08","order":7,"material":"","type":1,"place":200},{"boxId":"94263600107M847","x":-29.650000,"y":107.250000,"z":-583.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.600000,"platform":"platform08","order":8,"material":"","type":1,"place":200},{"boxId":"94263600107M833","x":72.849998,"y":89.500000,"z":-576.500000,"width":39.000000,"height":36.000000,"length":58.500000,"weight":21.299999,"platform":"platform08","order":9,"material":"","type":1,"place":200},{"boxId":"94263600107M845","x":-98.650002,"y":107.250000,"z":-557.750000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.520000,"platform":"platform08","order":10,"material":"","type":1,"place":200},{"boxId":"94263600107M851","x":-64.150002,"y":107.250000,"z":-557.750000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.500000,"platform":"platform08","order":11,"material":"","type":1,"place":200},{"boxId":"94263600107M848","x":-29.650000,"y":107.250000,"z":-557.750000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.480000,"platform":"platform08","order":12,"material":"","type":1,"place":200},{"boxId":"94263600107M831","x":72.849998,"y":89.500000,"z":-537.500000,"width":39.000000,"height":36.000000,"length":58.500000,"weight":21.299999,"platform":"platform08","order":13,"material":"","type":1,"place":200},{"boxId":"94263600107M834","x":23.600000,"y":89.500000,"z":-527.250000,"width":39.000000,"height":36.000000,"length":58.500000,"weight":21.200001,"platform":"platform08","order":14,"material":"","type":1,"place":100},{"boxId":"94263600107M850","x":-98.650002,"y":107.250000,"z":-532.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.440000,"platform":"platform08","order":15,"material":"","type":1,"place":200},{"boxId":"94263600107M852","x":-64.150002,"y":107.250000,"z":-532.250000,"width":25.500000,"height":9.500000,"length":34.500000,"weight":0.440000,"platform":"platform08","order":16,"material":"","type":1,"place":200},{"boxId":"94263600107M832","x":72.849998,"y":89.500000,"z":-498.500000,"width":39.000000,"height":36.000000,"length":58.500000,"weight":20.400000,"platform":"platform08","order":17,"material":"","type":1,"place":200},{"boxId":"94263600107Q588","x":-55.900002,"y":-81.250000,"z":-456.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":67.500000,"platform":"platform08","order":18,"material":"","type":1,"place":200},{"boxId":"94263600107Q587","x":-55.900002,"y":-16.750000,"z":-456.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":67.500000,"platform":"platform08","order":19,"material":"","type":1,"place":200},{"boxId":"94263600107Q157","x":-71.900002,"y":44.750000,"z":-468.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":31.500000,"platform":"platform08","order":20,"material":"","type":1,"place":200},{"boxId":"94263600107Q142","x":-89.400002,"y":91.750000,"z":-477.000000,"width":38.000000,"height":35.500000,"length":53.000000,"weight":28.750000,"platform":"platform08","order":21,"material":"","type":1,"place":200},{"boxId":"94263600107Q407","x":41.849998,"y":-86.500000,"z":-444.000000,"width":64.000000,"height":54.000000,"length":75.500000,"weight":69.000000,"platform":"platform08","order":22,"material":"","type":1,"place":200},{"boxId":"94263600107K871","x":41.849998,"y":-32.500000,"z":-444.000000,"width":64.000000,"height":54.000000,"length":75.500000,"weight":36.500000,"platform":"platform08","order":23,"material":"","type":1,"place":200},{"boxId":"94263600107M945","x":34.000000,"y":16.500000,"z":-456.850006,"width":38.299999,"height":44.000000,"length":59.799999,"weight":17.100000,"platform":"platform08","order":24,"material":"","type":1,"place":200},{"boxId":"94269180100N270","x":22.850000,"y":47.250000,"z":-457.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":7.120000,"platform":"platform08","order":25,"material":"","type":1,"place":200},{"boxId":"94263600107Q408","x":-75.900002,"y":-71.750000,"z":-386.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":53.000000,"platform":"platform08","order":26,"material":"","type":1,"place":200},{"boxId":"94263600107Q725","x":-75.900002,"y":11.750000,"z":-386.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":43.000000,"platform":"platform08","order":27,"material":"","type":1,"place":200},{"boxId":"94263600107Q097","x":-96.150002,"y":70.750000,"z":-396.250000,"width":39.500000,"height":34.500000,"length":39.500000,"weight":7.200000,"platform":"platform08","order":28,"material":"","type":1,"place":100},{"boxId":"94263600107P781","x":21.600000,"y":-82.500000,"z":-373.500000,"width":77.000000,"height":62.000000,"length":115.000000,"weight":617.000000,"platform":"platform05","order":29,"material":"","type":1,"place":200},{"boxId":"94263600107P714","x":-27.650000,"y":107.500000,"z":-527.250000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":7.850000,"platform":"platform09","order":30,"material":"","type":1,"place":200},{"boxId":"94263600107P780","x":-46.900002,"y":80.500000,"z":-480.000000,"width":32.000000,"height":13.000000,"length":32.000000,"weight":16.700001,"platform":"platform09","order":31,"material":"","type":1,"place":100},{"boxId":"94263600107P409","x":-16.650000,"y":20.250000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.840000,"platform":"platform09","order":32,"material":"","type":1,"place":100},{"boxId":"94263600107P872","x":-16.650000,"y":29.750000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.480000,"platform":"platform09","order":33,"material":"","type":1,"place":100},{"boxId":"94263600107P441","x":-16.650000,"y":39.250000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.400000,"platform":"platform09","order":34,"material":"","type":1,"place":100},{"boxId":"94263600107P609","x":-16.650000,"y":48.750000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":35,"material":"","type":1,"place":100},{"boxId":"94263600107P875","x":-16.650000,"y":58.250000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":36,"material":"","type":1,"place":100},{"boxId":"94263600107P874","x":-16.650000,"y":67.750000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":37,"material":"","type":1,"place":100},{"boxId":"94263600107P873","x":-16.650000,"y":77.250000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":38,"material":"","type":1,"place":100},{"boxId":"94263600107P864","x":-16.650000,"y":86.750000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":39,"material":"","type":1,"place":100},{"boxId":"94263600107N353","x":-16.650000,"y":96.250000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":40,"material":"","type":1,"place":100},{"boxId":"94263600107P715","x":-16.650000,"y":105.750000,"z":-477.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":41,"material":"","type":1,"place":100},{"boxId":"94263600107P871","x":22.850000,"y":67.750000,"z":-457.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":11.700000,"platform":"platform09","order":42,"material":"","type":1,"place":200},{"boxId":"94263600107P869","x":22.850000,"y":91.250000,"z":-457.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":11.700000,"platform":"platform09","order":43,"material":"","type":1,"place":200},{"boxId":"94263600107P724","x":22.850000,"y":107.750000,"z":-464.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":44,"material":"","type":1,"place":200},{"boxId":"94263600107Q152","x":97.349998,"y":-108.500000,"z":-456.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":2.900000,"platform":"platform09","order":45,"material":"","type":1,"place":100},{"boxId":"942636001073583","x":97.349998,"y":-98.500000,"z":-456.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":1.300000,"platform":"platform09","order":46,"material":"","type":1,"place":100},{"boxId":"94263600107P713","x":97.349998,"y":-88.500000,"z":-456.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":1.180000,"platform":"platform09","order":47,"material":"","type":1,"place":100},{"boxId":"94263600107P861","x":90.849998,"y":-78.750000,"z":-457.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":48,"material":"","type":1,"place":100},{"boxId":"94263600107P862","x":-97.150002,"y":99.750000,"z":-397.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":11.650000,"platform":"platform09","order":49,"material":"","type":1,"place":200},{"boxId":"94263600107P408","x":-56.900002,"y":69.000000,"z":-386.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":3.850000,"platform":"platform09","order":50,"material":"","type":1,"place":100},{"boxId":"94263600107N247","x":-57.650002,"y":96.250000,"z":-397.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":11.650000,"platform":"platform09","order":51,"material":"","type":1,"place":200},{"boxId":"94263600107P595","x":2.600000,"y":-24.500000,"z":-373.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":109.000000,"platform":"platform09","order":52,"material":"","type":1,"place":100},{"boxId":"94263600107P732","x":-5.650000,"y":24.500000,"z":-392.850006,"width":38.299999,"height":44.000000,"length":60.500000,"weight":20.740000,"platform":"platform09","order":53,"material":"","type":1,"place":200},{"boxId":"94263600107P716","x":-17.150000,"y":64.000000,"z":-393.250000,"width":37.500000,"height":35.000000,"length":37.500000,"weight":8.320000,"platform":"platform09","order":54,"material":"","type":1,"place":100},{"boxId":"94263600107P879","x":-17.150000,"y":90.250000,"z":-393.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":12.000000,"platform":"platform09","order":55,"material":"","type":1,"place":200},{"boxId":"94263600107P615","x":59.849998,"y":-42.750000,"z":-393.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":11.800000,"platform":"platform09","order":56,"material":"","type":1,"place":200},{"boxId":"94263600107P779","x":59.849998,"y":-25.250000,"z":-393.750000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":11.650000,"platform":"platform09","order":57,"material":"","type":1,"place":200},{"boxId":"94263600107P719","x":-75.900002,"y":-52.799999,"z":-296.000000,"width":80.000000,"height":121.400002,"length":120.000000,"weight":219.000000,"platform":"platform09","order":58,"material":"","type":1,"place":100},{"boxId":"94263600107P599","x":-75.900002,"y":58.700001,"z":-296.000000,"width":80.000000,"height":101.599998,"length":120.000000,"weight":460.500000,"platform":"platform09","order":59,"material":"","type":1,"place":100},{"boxId":"94263600107P718","x":24.100000,"y":-53.500000,"z":-295.000000,"width":80.000000,"height":120.000000,"length":120.000000,"weight":218.500000,"platform":"platform09","order":60,"material":"","type":1,"place":200},{"boxId":"94263600107P598","x":24.100000,"y":57.299999,"z":-295.000000,"width":80.000000,"height":101.599998,"length":120.000000,"weight":457.000000,"platform":"platform09","order":61,"material":"","type":1,"place":200},{"boxId":"94263600107R286","x":24.100000,"y":-53.799999,"z":-215.000000,"width":80.000000,"height":119.400002,"length":120.000000,"weight":181.500000,"platform":"platform09","order":62,"material":"","type":1,"place":200},{"boxId":"94263600107P600","x":24.100000,"y":56.349998,"z":-215.000000,"width":80.000000,"height":100.900002,"length":120.000000,"weight":459.000000,"platform":"platform09","order":63,"material":"","type":1,"place":200},{"boxId":"94263600107R284","x":-75.900002,"y":-54.849998,"z":-176.000000,"width":80.000000,"height":117.300003,"length":120.000000,"weight":178.000000,"platform":"platform09","order":64,"material":"","type":1,"place":100},{"boxId":"94263600107P596","x":-75.900002,"y":53.549999,"z":-176.000000,"width":80.000000,"height":99.500000,"length":120.000000,"weight":457.000000,"platform":"platform09","order":65,"material":"","type":1,"place":100},{"boxId":"94263600107R282","x":24.100000,"y":-54.849998,"z":-135.000000,"width":80.000000,"height":117.300003,"length":120.000000,"weight":177.000000,"platform":"platform09","order":66,"material":"","type":1,"place":200},{"boxId":"94263600107P597","x":24.100000,"y":53.200001,"z":-135.000000,"width":80.000000,"height":98.800003,"length":120.000000,"weight":459.000000,"platform":"platform09","order":67,"material":"","type":1,"place":200},{"boxId":"94263600107R285","x":-75.900002,"y":-54.849998,"z":-56.000000,"width":80.000000,"height":117.300003,"length":120.000000,"weight":172.000000,"platform":"platform09","order":68,"material":"","type":1,"place":100},{"boxId":"94263600107P717","x":-75.900002,"y":46.150002,"z":-56.000000,"width":80.000000,"height":84.699997,"length":120.000000,"weight":152.500000,"platform":"platform09","order":69,"material":"","type":1,"place":100},{"boxId":"94263600107P207","x":-89.650002,"y":98.750000,"z":-94.750000,"width":42.500000,"height":20.500000,"length":52.500000,"weight":15.250000,"platform":"platform09","order":70,"material":"","type":1,"place":200},{"boxId":"94263600107R281","x":24.100000,"y":-54.849998,"z":-55.000000,"width":80.000000,"height":117.300003,"length":120.000000,"weight":171.500000,"platform":"platform09","order":71,"material":"","type":1,"place":200},{"boxId":"94263600107K873","x":24.100000,"y":46.049999,"z":-55.000000,"width":80.000000,"height":84.500000,"length":120.000000,"weight":101.000000,"platform":"platform09","order":72,"material":"","type":1,"place":200},{"boxId":"94263600107P205","x":-9.650000,"y":98.550003,"z":-73.750000,"width":42.500000,"height":20.500000,"length":52.500000,"weight":8.680000,"platform":"platform09","order":73,"material":"","type":1,"place":200},{"boxId":"94263600107R283","x":24.100000,"y":-55.200001,"z":25.000000,"width":80.000000,"height":116.599998,"length":120.000000,"weight":169.000000,"platform":"platform09","order":74,"material":"","type":1,"place":200},{"boxId":"94263600107N159","x":24.100000,"y":58.150002,"z":25.000000,"width":80.000000,"height":110.099998,"length":120.000000,"weight":295.000000,"platform":"platform09","order":75,"material":"","type":1,"place":200},{"boxId":"94263600107R287","x":-75.900002,"y":-55.200001,"z":64.000000,"width":80.000000,"height":116.599998,"length":120.000000,"weight":166.000000,"platform":"platform09","order":76,"material":"","type":1,"place":100},{"boxId":"94263600107K875","x":-75.900002,"y":45.349998,"z":64.000000,"width":80.000000,"height":84.500000,"length":120.000000,"weight":99.500000,"platform":"platform09","order":77,"material":"","type":1,"place":100},{"boxId":"94263600107N349","x":24.100000,"y":-57.400002,"z":105.000000,"width":80.000000,"height":112.199997,"length":120.000000,"weight":300.500000,"platform":"platform09","order":78,"material":"","type":1,"place":200},{"boxId":"94263600107N350","x":24.100000,"y":54.799999,"z":105.000000,"width":80.000000,"height":112.199997,"length":120.000000,"weight":295.000000,"platform":"platform09","order":79,"material":"","type":1,"place":200},{"boxId":"94263600107N160","x":-75.900002,"y":-57.750000,"z":184.000000,"width":80.000000,"height":111.500000,"length":120.000000,"weight":295.500000,"platform":"platform09","order":80,"material":"","type":1,"place":100},{"boxId":"94263600107N351","x":-75.900002,"y":53.400002,"z":184.000000,"width":80.000000,"height":110.800003,"length":120.000000,"weight":295.000000,"platform":"platform09","order":81,"material":"","type":1,"place":100},{"boxId":"94263600107K874","x":24.100000,"y":-71.250000,"z":185.000000,"width":80.000000,"height":84.500000,"length":120.000000,"weight":98.000000,"platform":"platform09","order":82,"material":"","type":1,"place":200},{"boxId":"94263600107P405","x":24.100000,"y":8.750000,"z":185.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":132.000000,"platform":"platform09","order":83,"material":"","type":1,"place":200},{"boxId":"94263600107K872","x":24.100000,"y":78.750000,"z":185.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":76.000000,"platform":"platform09","order":84,"material":"","type":1,"place":200},{"boxId":"94263600107N352","x":8.100000,"y":-84.250000,"z":253.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":56.500000,"platform":"platform09","order":85,"material":"","type":1,"place":200},{"boxId":"94263600107N161","x":8.100000,"y":-25.750000,"z":253.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":56.000000,"platform":"platform09","order":86,"material":"","type":1,"place":200},{"boxId":"94263600107P737","x":8.100000,"y":32.750000,"z":253.000000,"width":56.000000,"height":58.500000,"length":88.000000,"weight":34.500000,"platform":"platform09","order":87,"material":"","type":1,"place":200},{"boxId":"94263600107P735","x":82.099998,"y":-71.750000,"z":265.000000,"width":60.000000,"height":83.500000,"length":80.000000,"weight":71.500000,"platform":"platform09","order":88,"material":"","type":1,"place":100},{"boxId":"94263600107P722","x":72.349998,"y":6.750000,"z":264.250000,"width":40.500000,"height":73.500000,"length":78.500000,"weight":22.000000,"platform":"platform09","order":89,"material":"","type":1,"place":100},{"boxId":"94263600107P899","x":4.100000,"y":87.500000,"z":249.000000,"width":48.000000,"height":51.000000,"length":80.000000,"weight":47.599998,"platform":"platform04","order":90,"material":"","type":1,"place":200},{"boxId":"94263600107Q107","x":70.849998,"y":55.250000,"z":243.250000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":8.220000,"platform":"platform04","order":91,"material":"","type":1,"place":200},{"boxId":"94263600107P932","x":70.849998,"y":75.750000,"z":243.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":5.280000,"platform":"platform04","order":92,"material":"","type":1,"place":200},{"boxId":"94263600107P945","x":70.849998,"y":93.250000,"z":243.250000,"width":36.500000,"height":17.500000,"length":37.500000,"weight":5.240000,"platform":"platform04","order":93,"material":"","type":1,"place":200},{"boxId":"94263600107Q106","x":-75.900002,"y":-75.750000,"z":304.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":122.500000,"platform":"platform04","order":94,"material":"","type":1,"place":100},{"boxId":"94263600107Q105","x":-75.900002,"y":-0.250000,"z":304.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":122.500000,"platform":"platform04","order":95,"material":"","type":1,"place":100},{"boxId":"94263600107P969","x":-75.900002,"y":75.250000,"z":304.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":93.599998,"platform":"platform04","order":96,"material":"","type":1,"place":100},{"boxId":"94263600107P604","x":4.100000,"y":-81.250000,"z":341.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":83.400002,"platform":"platform04","order":97,"material":"","type":1,"place":100},{"boxId":"94263600107P603","x":4.100000,"y":-16.750000,"z":341.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":82.199997,"platform":"platform04","order":98,"material":"","type":1,"place":100},{"boxId":"94263600107P602","x":4.100000,"y":47.750000,"z":341.000000,"width":80.000000,"height":64.500000,"length":120.000000,"weight":74.599998,"platform":"platform04","order":99,"material":"","type":1,"place":100},{"boxId":"94263600107Q090","x":74.099998,"y":-68.000000,"z":345.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.599998,"platform":"platform04","order":100,"material":"","type":1,"place":100},{"boxId":"94263600107Q067","x":74.099998,"y":23.000000,"z":345.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.599998,"platform":"platform04","order":101,"material":"","type":1,"place":100},{"boxId":"94263600107Q065","x":-75.900002,"y":-68.000000,"z":394.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.400002,"platform":"platform04","order":102,"material":"","type":1,"place":200},{"boxId":"94263600107Q080","x":-75.900002,"y":23.000000,"z":394.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.199997,"platform":"platform04","order":103,"material":"","type":1,"place":200},{"boxId":"94263600107Q089","x":74.099998,"y":-68.000000,"z":425.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.199997,"platform":"platform04","order":104,"material":"","type":1,"place":100},{"boxId":"94263600107Q088","x":74.099998,"y":23.000000,"z":425.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.199997,"platform":"platform04","order":105,"material":"","type":1,"place":100},{"boxId":"94263600107Q064","x":4.100000,"y":-68.000000,"z":431.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.199997,"platform":"platform04","order":106,"material":"","type":1,"place":200},{"boxId":"94263600107Q066","x":4.100000,"y":23.000000,"z":431.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.000000,"platform":"platform04","order":107,"material":"","type":1,"place":200},{"boxId":"94263600107Q053","x":-75.900002,"y":-68.000000,"z":454.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.000000,"platform":"platform04","order":108,"material":"","type":1,"place":200},{"boxId":"94263600107Q068","x":-75.900002,"y":23.000000,"z":454.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":103.000000,"platform":"platform04","order":109,"material":"","type":1,"place":200},{"boxId":"94263600107Q069","x":4.100000,"y":-68.000000,"z":491.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.800003,"platform":"platform04","order":110,"material":"","type":1,"place":200},{"boxId":"94263600107Q082","x":4.100000,"y":23.000000,"z":491.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.800003,"platform":"platform04","order":111,"material":"","type":1,"place":200},{"boxId":"94263600107Q086","x":74.099998,"y":-68.000000,"z":505.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.599998,"platform":"platform04","order":112,"material":"","type":1,"place":100},{"boxId":"94263600107Q076","x":74.099998,"y":23.000000,"z":505.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.400002,"platform":"platform04","order":113,"material":"","type":1,"place":100},{"boxId":"94263600107Q079","x":-75.900002,"y":-68.000000,"z":514.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.400002,"platform":"platform04","order":114,"material":"","type":1,"place":200},{"boxId":"94263600107Q081","x":-75.900002,"y":23.000000,"z":514.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":102.199997,"platform":"platform04","order":115,"material":"","type":1,"place":200},{"boxId":"94263600107P931","x":4.100000,"y":-78.500000,"z":545.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.400002,"platform":"platform04","order":116,"material":"","type":1,"place":200},{"boxId":"94263600107P928","x":4.100000,"y":-8.500000,"z":545.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.400002,"platform":"platform04","order":117,"material":"","type":1,"place":200},{"boxId":"94263600107P930","x":4.100000,"y":61.500000,"z":545.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.199997,"platform":"platform04","order":118,"material":"","type":1,"place":200},{"boxId":"94263600107P901","x":-75.900002,"y":-78.500000,"z":568.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.199997,"platform":"platform04","order":119,"material":"","type":1,"place":200},{"boxId":"94263600107P909","x":-75.900002,"y":-8.500000,"z":568.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.000000,"platform":"platform04","order":120,"material":"","type":1,"place":200},{"boxId":"94263600107P907","x":-75.900002,"y":61.500000,"z":568.000000,"width":48.000000,"height":70.000000,"length":80.000000,"weight":67.000000,"platform":"platform04","order":121,"material":"","type":1,"place":200}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":227.000000,"container_max_load":23000.000000,"container_type_name":"40GP"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>